#include "Map.h"

namespace Gw2API{

Map::Map(std::string *id, std::string *name)
{
	if(id != 0)
		map_id = atoi(id->c_str());
	if(name != 0)
		map_name = *name;
}


Map::~Map(void)
{
}


int Map::updateEvent(std::string *evtId, std::string *evtState){
	std::vector<Event>::iterator it;
	int opCode = EVENT_UPDATE_ERROR_EVTNOTFOUND;
	for(it = events.begin(); it != events.end(); it++){
		if(strcmp(it->getId()->c_str(), evtId->c_str()) == 0){
			it->updateState(evtState)?opCode = EVENT_UPDATE_SUCCESS : opCode = EVENT_UPDATE_ERROR_UNDEFEVT;
			break;
		}
	}
	return opCode;
}

};